const SYSTEM_TOKEN  = 'system-token'   // 认真的token

const SYSTEM_USER  = 'system-user'     // 用户信息的KEY值

// 获取token
export function getToken(){ 
    var tonkenInfo = localStorage.getItem(SYSTEM_TOKEN);
    console.log("token cache-get:",tonkenInfo);
    if(tonkenInfo == null || tonkenInfo == undefined ){
        return null;
    }
    // var longdate = new Date().getTime();
    // if((longdate - tonkenInfo.longtime)/1000 > 7000) {
    //     return null;
    // }
    return tonkenInfo;
}
// 添加token
export function setToken(token){ 
    console.log("token cache:",token)
    return localStorage.setItem(SYSTEM_TOKEN,token) ;
}
// 获取用户信息
export function getUser(){ 

    return localStorage.getItem(SYSTEM_USER) ;
}
// 设置用户信息
export function setUser(user){ 
    console.log("user cache:",token)
    return localStorage.setItem(SYSTEM_USER,user) ;
}
//移除所有的信息
export function  removeAll(){
    localStorage.removeItem(SYSTEM_TOKEN)
    localStorage.removeItem(SYSTEM_USER)
}